home *** CD-ROM | disk | FTP | other *** search
- From: _GOYRA_@msn.com (David Byrden)
- Subject: RE: Explicit copy constructor calls illegal?
- Date: 15 Mar 96 04:30:55 -0800
- References: <4i9tp8$fgt@reznor.larc.nasa.gov>
- Message-ID: <00001a81+0000ad4e@msn.com>
- Path: news.msn.com!msn.com
- Newsgroups: comp.lang.c++
- Organization: The Microsoft Network (msn.com)
-
-
- >> When I try to do this (just trying to re-use code - it is there, why not?),
- >> a new instance of the class is instantiated SOMEWHERE
-
- Well, you didn't post your code, but be advised that explicit ctor
- calls are not possible, no matter how much you would like to reuse
- the code. All ctor calls are associated with the creation of a fresh
- object. When you call the copy ctor, I guess you create a temporary
- object, whose lifetime does not extend beyond its own statement.
- Hence you should see the copy ctor and the dtor called for this
- temporary object.
-
- David
-